package com.huanf.domain.pojo;

import lombok.Data;

/**
 * 获取Access token之后，会封装到这个类
 */
@Data
public class AccessToken {
    private String token;
    private Long expireTime;

    public void setExpireTime(long expireTime) {
        this.expireTime = System.currentTimeMillis() + expireTime*1000;
    }

    /**
     * 判断token是否超时
     * @return
     */
    public Boolean isExpired() {
        return System.currentTimeMillis() > this.expireTime;
    }


}
